/**
 * User: alesj
 * Date: 2005.6.1
 * Time: 15:33:28
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.alesj.newsfeed.data;

import java.io.Serializable;
import java.util.Set;

import com.generalynx.common.data.ADEData;
import com.generalynx.common.web.tags.SelectOption;
import com.generalynx.common.resources.Resources;

public class Group extends ADEData implements SelectOption, Serializable {

    private static final long serialVersionUID = 1L;

    private int id;
    private String name;
    private String description;
    private Set entries;

    public String getAddLabel() {
        return Resources.getString(Resources.GROUP);
    }

    protected String getNameLabel() {
        return getName();
    }

    protected String getInfo() {
        return String.valueOf(getEntries().size());
    }

    protected String getSelectAction() {
        return "groupEntrySelect";
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isAssociation() {
        return true;
    }

    public Serializable getIdentifier() {
        return new Integer(getId());
    }

    public boolean isCacheable() {
        return false;
    }

    public int getSize() {
        return (getEntries().size() + 1);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Set getEntries() {
        return entries;
    }

    public void setEntries(Set entries) {
        this.entries = entries;
    }
}
